class Post < ActiveRecord::Base
  belongs_to :category
  belongs_to :member
  has_many :postlinks
  has_many :comments, {:as => :commentable, :dependent => :delete_all}
  validates_presence_of :title, :content, :slug, :category_id
  
  def url
    return '/'+ self.category.slug + '/' + self.slug
  end
  
  def short_content
  	return self.content.split('[more]').first
  end

end
